#include "../../muduo/socket.hpp"

int main()
{
    Muduo::Socket listen_sock;
    listen_sock.CreateServer(8080);
    while(true)
    {
        int newfd = listen_sock.Accept();
        if(newfd<0) continue;
        Muduo::Socket client_sock(newfd);
        char buf[1024] = {0};
        int ret = client_sock.Recv(buf,1023);
        DLOG("%s",buf);
        if(ret<0)
        {
            client_sock.Close();
            continue;
        }
        client_sock.Send(buf,ret);
        client_sock.Close();
    }
    listen_sock.Close();
    return 0;
}
